File manager - Edit - /home/autoph/public_html/projects/AutoHub-Kiosk-Final/app/Http/Controllers/SMSController.php
Back
<?php namespace App\Http\Controllers; use App\Models\Link; use App\Models\Transaction; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Str; use DB; class SMSController extends Controller { public function sendSMS($array_data){ //Your message to send, Add URL encoding here. $message = urlencode($array_data['message']); //Prepare you post parameters $postData = array( 'key' => $array_data['key'], 'mobile' => $array_data['mobile'], 'message' => $message, ); $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $array_data['uri'], CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $postData //,CURLOPT_FOLLOWLOCATION => true )); //Ignore SSL certificate verification curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); //get response $output = curl_exec($ch); //Print error if any if(curl_errno($ch)) { echo 'error:' . curl_error($ch); } return $output; } public function tinyUrl($url){ $api_url = 'https://tinyurl.com/api-create.php?url=' . "https://guest.autohub.ph".$url; $curl = curl_init(); $timeout = 10; curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_URL, $api_url); $new_url = curl_exec($curl); curl_close($curl); return $new_url; } // this function returns the long url as tiny url using the api of tinyUrl }
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings